<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/2/20 0020
 * Time: 15:04
 */

namespace prototype;

class Prototype extends PrototypeAbstract
{
    /**
     * 构造函数
     * Prototype constructor.
     * @param string $name 属性1
     */
    public function __construct($name = "")
    {
        $this->_name = $name;
    }

    /**
     * 设置属性
     * @param $name 属性名称
     * @param $value 属性值
     */
    public function __set($name, $value)
    {
        // TODO: Implement __set() method.
        $this->$name = $value;
    }

    public function getName()
    {
        // TODO: Implement getName() method.
        echo "我是对象:" . $this->_name . " \n\n";
    }

    public function getPrototype()
    {
        // TODO: Implement getPrototype() method.
        return clone $this;
    }
}